This document contains information about the replication files for:

Thesen, Gunnar, and Yildirim, Tevfik Murat. 2022. “Electoral Systems and Gender Inequality in Political News: Analyzing the News Visibility of Members of Parliament in Norway and the UK”. American Political Science Review.

Software information: 
Initial data management was run using R version 4.0.4. The remaining data preparation and analysis was run using Stata.


The replication files are organised in five folders, described below. In addition, the root folder contains the present README-file and a variable list describing variables in the main dataset for analysis (quarterly data). 

Note that when replicating our analyses one could follow two different approaches: 
1. The first involves redoing data preparation by running all code in file 1 of each of the 4 first folders described below. This should be done in the following order: Start with two R-scripts of the two folders \Prepare ParlSpeech data\ and \Prepare ToN data\. Next, run the two do-files of the two folders \Prepare Norwegian media data\ and \Prepare UK media data\. This will produce all the datasets used in the analyses that are reported in the manuscript and the supplementary materials. The datasets can then be analysed by running the do-file in the folder \Files for analysis\. 

2. The datasets produced in the first approach are already uploaded in the fifth folder described below (\Files for analysis\). The second approach therefore involves skipping data preparation and running the analysis code of file 1 in that folder.




The folder \Prepare ToN data\ includes files used in the preparation of the Talk of Norway dataset plus additional metadata:

1. prepare_ToN_data.R: Code to clean and aggregate the Talk of Norway dataset with legislative speech data from the Storting, and to add other metadata.

2. ToN_noTxt.rds: The Talk of Norway dataset, excluding speech text (for efficiency), downloaded from https://github.com/ltgoslo/talk-of-norway

3. mps_matched_ton_and_maml.xlsx: List of MPs based on (a combination of automatic and manual) matching of MPs' names in the ToN data and in the Norwegian media corpus.

4. committees.xlsx: Parliamentary committees including variable for soft / hard categorization.

5. counties.xlsx: Counties including variable for relative distance to capital.

6. constituency_size.xlsx: List providing district size in seats, turnout and electorate size.

7. partyleaders_no.xlsx: List of party leaders.

8. ton_mp_X_months.dta: The output generated from file 1, exported to stata format.




The folder \Prepare ParlSpeech data\ includes files used in the preparation of the ParlSpeech dataset for UK:

1. prepare_ParlSpeech_data.R: Code to clean and aggregate the ParlSpeech dataset with legislative speech data from the House of Commons.

2. parlspeech_notxt.rds: The ParlSpeech data from UK, excluding speech text and observations from before our period of study (for efficiency), downloaded from https://dataverse.harvard.edu/dataverse/ParlSpeech

3. mps_uk.xlsx: List of MPs compiled for the UK media corpus, used to match with Speaker name in ParlSpeech.

4. partyleaders_uk.xlsx: List of party leaders.

5. parlspeech_mp_X_month.dta: The output generated from file 1, exported to stata format.




The folder \Prepare Norwegian media data\ includes files used in the preparation of the Norwegian media corpus plus additional metadata:

1. prepare_norwegian_data.do: Code to clean and aggregate data from the Norway media corpus, adding other metadata and combining with the speech data (ToN). Produces three final datasets for analysis of Norwegian data that can be found in the folder \Files for analysis \ 

2. article_level_norway.dta: The Norwegian media corpus data, including count of occurences of all MPs in all articles.

3. mps_first_year_no.dta: List of MPs' first year elected to the Norwegian Storting.

4. gender_and_experience.dta: Data on gender and years of experience as MP, generated from files 2 and 3.

5. cabinet party meta data no.dta: Data on cabinets, parties and elections available from ParlGov.

6. tally_months_no.dta: List of yearmonths and distance to election.

NOTE: The intermediary output file mp_X_month norway.dta that will be generated from the code in file 1 is not included in this folder.




The folder \Prepare UK media data\ includes files used in the preparation of the UK media corpus plus additional metadata:

1. prepare_uk_data.do: Code to clean and aggregate data from the UK media corpus, adding other metadata and combining with the ParlSpeech data. Produces two final datasets for analysis of UK data that can be found in the folder \Files for analysis \ 

2. article_level_unitedkingdom.dta: The UK media corpus data, including count of occurences of all MPs in all articles.

3. mps_first_elected_uk.dta: List of MPs' first year elected to the House of Commons.

4. gender_and_experience.dta: Data on gender and years of experience as MP, generated from files 2 and 3.

5. cabinet party meta data uk.dta: Data on cabinets, parties and elections available from ParlGov.

6. constituency election meta uk.dta: Data on electoral safety, constituency size (in population) and turnout compiled from various versions of the British Parliamentary Constituency Database, see https://sites.google.com/site/pippanorris3/research/data 

7. tally_months_uk.dta: List of yearmonths and distance to election.

NOTE: The intermediary output file mp_X_month uk.dta that will be generated from the code in file 1 is not included in this folder.




The folder \Files for analysis\ includes files used to produce the results reported in the paper and supplementary material:

1. Replication code Thesen Yildirim APSR Analyses.do: Code to run all analyses in manuscript and supplementary materials.

2. data figure 1 world development indicator.dta: Data on share of women MPs in Norway and UK, used for figure 1 and available from the World Development Indicator.

3. quarterly data uk.dta: Quarterly dataset generated from files in folder \Prepare UK media data\

4. quarterly data norway.dta: Quarterly dataset generated from files in folder \Prepare Norwegian media data\

5. monthly data uk.dta: Monthly dataset generated from files in folder \Prepare UK media data\

6. monthly data norway.dta: Monthly dataset generated from files in folder \Prepare Norwegian media data\

7. monthly data norway incl legspeechNAs.dta: Monthly dataset generated from files in folder \Prepare Norwegian media data\, used for Norwegian results in table A9 that distinguishes between election and routine time periods. Unlike file 6, this dataset contains the months with no activity in the Storting, including the election months (always September).

8. pooled quarterly data norway uk.dta: Pooled dataset with quarterly observations from both Norway and UK, generated by code in file 1.

NOTE: The output files used for tables and figures in the manuscript/supplementary materials will be generated by the code in file 1, but are not included in this folder.
